package com.dailyye.sex360;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

public class ImageGridTempView extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.image); 
       
        
        Intent intent = getIntent();
        final String [] content = intent.getStringArrayExtra("contentTemp");
        final Integer[] mThumbIds = (Integer[]) intent.getSerializableExtra("imagesTemp");  
       
        
        GridView gridview = (GridView) findViewById(R.id.gridview);
        gridview.setAdapter(new ImageAdapterTemp(this,mThumbIds));
        
        gridview.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                //Toast.makeText(ImageGridView.this, "" + position, Toast.LENGTH_SHORT).show();
                Intent intent;  // Reusable Intent for each tab 
            	intent = new Intent().setClass(ImageGridTempView.this, ReadView.class); 
            	intent.putExtra("content", content[position]);   
            	intent.putExtra("imageid", mThumbIds[position]);   
            	startActivity(intent);  
            }
        });
    }


}